package com.example.bes.payment.service.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @GetMapping(value = "/pay")
    public String test() {
        System.out.println("hello");
        return "SUCCESS";
    }

    /**
     * 模拟异常，测试熔断
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/circuit")
    public String circuit() throws Exception {
        int a = 10/0;
        return "exception";
    }

    /**
     * 测试限流
     * @return
     */
    @GetMapping(value = "/currentlimiting")
    public String currentlimiting() {
        return "限流测试";
    }

}
